A5Storage::SubContainer Open Method
Syntax
.Open as A5Storage::CallResult (BYREF SubContainerResult as P, Cache as A5Storage::NameCache, ConnectionString as C, Prefix as C [, PassPhrase as C])
.Open as A5Storage::CallResult (BYREF SubContainerResult as P, ConnectionString as C, Prefix as C [, PassPhrase as C])
Arguments
- BYREF SubContainerResultPointer
- CacheA5Storage::NameCache
Defines a set of Storage container connection strings.
- ConnectionStringCharacter
The connection string for the Storage container.
- PrefixCharacter
- PassPhraseCharacter
A passphrase used to decrypt the connection string. Only required if the connection string is encrypted.
Returns
- ResultA5Storage::CallResult
Information about whether or not the operation succeed. Result.Success with be .T. if the operation succeeds, otherwise .F.
Description
Opens a Storage SubContainer based on a connection string and the prefix provided.
Example: Connect to a Storage Container
dim CallResult as CallResult
dim SubContainer as A5Storage::SubContainer = null_value()
CallResult = A5Storage::SubContainer::Open(SubContainer, "Provider='Disk';Container='c:\A5Webroot';", "logs")
if CallResult.Success
' etc
end ifExample: Connect to Multiple Storage Containers
The connection string passed in this example does not have to be a named connection. If you pass a named connection, you must also provide a cache to look it up in.
dim CallResult as CallResult
dim SubContainer as A5Storage::SubContainer = null_value()
dim Storages as C = <<%txt%
Storage1 Provider='Disk';Container='C:\A5WebRoot1';
Storage2 Provider='Disk';Container='C:\A5WebRoot2';
%txt%
dim Cache as A5Storage::NameCache = new A5Storage::NameCache(Storages)
CallResult = A5Storage::SubContainer::Open(SubContainer, Cache, "::NAME::MyConnectionString", "logs")
if CallResult.Success
' etc
end if